package com.yunhoo.base.db.impl;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.yunhoo.sys.db.util.IbatisTemplate;
import com.yunhoo.sys.util.common.LoginParam;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Administrator
 */
public class BusinessParameterImpl {

    private static String nameSpace = "businessParam.";

    private static Map paramMap() {
        Map map = new HashMap();
        map.put("orgCode", LoginParam.getOrg().getCode());
        return map;
    }

    public static String queryParamValue(String str) {
        Map map = paramMap();
        map.put("model", "pay");
        map.put("paramName", "finProject");
        map.put("paramValue", str);
        String paramValue = (String) IbatisTemplate.query(nameSpace + "queryParamValue", map);
        return paramValue == null ? "0" : paramValue;
    }

    public static String queryParamValue(SqlMapClient client, String str) throws SQLException {
        Map map = paramMap();
        map.put("model", "pay");
        map.put("paramName", "finProject");
        map.put("paramValue", str);
        return (String) client.queryForObject(nameSpace + "queryParamValue", map);
    }
}
